Object.prototype.say = 'hello'


const obj = {
  name: '张三',
  age: 18,
  like: {
    n: 'running'
  }
}

function shallow(obj) {
  let res = {}
  for (let key in obj) {
    if (obj.hasOwnProperty(key)) {
      res[key] = obj[key]
    }
  }
  return res
}

console.log(shallow(obj));    // { name: '张三', age: 18, like: { n: 'running' } }

